package cate.game.train.furniture.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import cate.game.role.bag.vo.UidPosVO;
import easy.java.dev.note.NoteField;

import java.util.List;

@ClientMsg(title = "英雄穿手办の 请求")
@OperationSetter(GDOperation.FURNITURE_ON)
public class FurnitureOnReq implements MsgInput {
    @NoteField(value = "英雄uid", detail = "要给哪一个英雄穿装备")
    public String heroUid;

    @NoteField(value = "手办们")
    public List<UidPosVO> furnitures;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.furniture.on(cc.getRole(), heroUid, furnitures);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.HERO_FURNITURE_ON_REQ;
    }
}
